﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="CadastroSelecionador.aspx.cs" Inherits="PortalCurriculo.WebUI.Empresas.CadastroSelecionador" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="PortalCurriculo.Util.CustomControls" Namespace="PortalCurriculo.Util.CustomControls" TagPrefix="portal" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PageTitle" runat="server">
    <asp:Label runat="server" ID="lblTitulo" Text="Cadastro de Selecionadores" CssClass="pageTitle" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <asp:UpdatePanel runat="server" ID="updSelecionador" >
        <ContentTemplate>
             <table cellspacing="10px">
                <tr>
                    <td><asp:Label ID="lblNome" runat="server" Text="Nome" /></td>
                    <td style="margin-left: 40px">
                        <asp:TextBox ID="txtNome" runat="server" MaxLength="70" />
                        <asp:RequiredFieldValidator ID = "RequiredValidatorNome" runat="server" ControlToValidate="txtNome" 
                            CssClass="failureNotification" ErrorMessage="Preencha o campo email" ToolTip="Campo obrigatório" 
                            ValidationGroup="SelecionadorValidationGroup" Text="*" />
                    </td>
                </tr>
                <tr>
                    <td><asp:Label ID="lblCPF" runat="server" Text="CPF" /></td>
                    <td>
                        <asp:TextBox ID="txtCPF" runat="server" />
                        <portal:MaskedEdit ID="mskCPF" runat="server" Type="CPF" TargetControlID="txtCPF" /> 
                        <portal:MaskEditValidator ID="MaskEditValidatorCPF" ControlToValidate="txtCPF" ControlExtender="mskCPF"
                            runat="server" CssClass="failureNotification" IsValidEmpty="false" Display="Dynamic"
                            EmptyValueMessage="Preencha o campo de CPF" EmptyValueBlurredText="*"
                            InvalidValueMessage="CPF inválido" InvalidValueBlurredMessage="*" 
                            ValidationGroup="SelecionadorValidationGroup" />
                    </td>
                </tr>
                <tr>
                    <td><asp:Label ID="lblEmail" runat="server" Text="Email" /></td>
                    <td style="margin-left: 40px">
                        <asp:TextBox ID="txtEmail" runat="server" MaxLength="70" />
                        <asp:RequiredFieldValidator ID = "RequiredValidatorEmail" runat="server" ControlToValidate="txtEmail" 
                            CssClass="failureNotification" ErrorMessage="Preencha o campo email" ToolTip="Campo obrigatório" 
                            ValidationGroup="SelecionadorValidationGroup" Text="*" />
                        <asp:RegularExpressionValidator runat="server" ID="ValidatorEmail" ControlToValidate="txtEmail" Text="*"
                            CssClass="failureNotification" ErrorMessage="Preencha com um email válido" SetFocusOnError="true"
                            ValidationGroup="SelecionadorValidationGroup" 
                            ValidationExpression="^(([\w-]+\.)+[\w-]+|([a-zA-Z]{1}|[\w-]{2,}))@((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?
				                [0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?
				                [0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|([a-zA-Z]+[\w-]+\.)+[a-zA-Z]{2,4})$" />
                        <asp:CustomValidator runat="server" ID="CustomValidatorEmail" ControlToValidate="txtEmail"  
                                CssClass="failureNotification" Text="*" ErrorMessage="Email já cadastrado no Portal Currículo"
                                ValidationGroup="SelecionadorValidationGroup" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2"><asp:LinkButton runat="server" ID="lnkAdicionar" Text="Adicionar" 
                            ValidationGroup="SelecionadorValidationGroup" onclick="lnkAdicionar_Click" /></td>
                </tr>
            </table>

            <br />
            <asp:TabContainer ID="tabSelecionador" runat="server">
                <asp:TabPanel runat="server" ID="pnlSelecionadores" HeaderText="Selecionadores">
                    <ContentTemplate>
                        <asp:Label runat="server" ID="lblSelecionadores" Text="Selecionadores que confirmaram seu cadastro" CssClass="title" /> 
                        <br /><br />

                        <portal:ListView ID="lsvSelecionador" runat="server" ItemPlaceholderID="phItens" 
                             onitemdatabound="lsvSelecionador_ItemDataBound">
                            <LayoutTemplate>
                                <table width="100%">
                                    <tr>    
                                        <td style="width:40%;text-align:center;"><asp:Label runat="server" ID="lblNome" Text="Nome" /></td>
                                        <td style="width:40%;text-align:center;"><asp:Label runat="server" ID="lblEmail" Text="Email" /></td>
                                        <td style="width:30%;text-align:center;"><asp:Label runat="server" ID="lblCPF" Text="CPF" /></td>
                                        <td style="width:15px;"></td>
                                    <asp:PlaceHolder ID="phItens" runat="server" />
                                </table>
                            </LayoutTemplate>
                            <ItemTemplate>
                                <tr>
                                    <td><asp:Label runat="server" ID="lblNome" /></td>
                                    <td><asp:Label runat="server" ID="lblEmail" /></td>
                                    <td><asp:Label runat="server" ID="lblCPF" /></td>
                                    <td><asp:ImageButton runat="server" ID="imbEstatisticas" ImageUrl="~/Files/Layout/Detalhes.gif"/> </td>
                                    <td><asp:ImageButton runat="server" ID="imbExcluir" ImageUrl="~/Files/Layout/Excluir.gif" 
                                        OnClick="imbExcluir_Click" OnClientClick="javascript:return confirm('Tem certeza que deseja excluir esse selecionador?');" /> </td>
                                </tr>
                            </ItemTemplate>
                            <EmptyDataTemplate>
                                <asp:Label runat="server" ID="lblVazio" Text="Não há selecionadores" CssClass="failureNotification" />
                            </EmptyDataTemplate>
                        </portal:ListView>
                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel runat="server" ID="pnlSelecionadorPendente" HeaderText="Selecionadores pendentes">
                    <ContentTemplate>
                        <asp:Label runat="server" ID="lblSelecionadorPendente" Text="Selecionadores pendentes" CssClass="title" /> 
                        <br /><br />

                        <portal:ListView ID="lsvSelecionadorPendente" runat="server" ItemPlaceholderID="phItens" 
                             onitemdatabound="lsvSelecionadorPendente_ItemDataBound">
                            <LayoutTemplate>
                                <table width="100%">
                                    <tr>    
                                        <td style="width:40%;text-align:center;"><asp:Label runat="server" ID="lblNome" Text="Nome" /></td>
                                        <td style="width:40%;text-align:center;"><asp:Label runat="server" ID="lblEmail" Text="Email" /></td>
                                        <td style="width:30%;text-align:center;"><asp:Label runat="server" ID="lblCPF" Text="CPF" /></td>
                                        <td style="width:15px;"></td>
                                    <asp:PlaceHolder ID="phItens" runat="server" />
                                </table>
                            </LayoutTemplate>
                            <ItemTemplate>
                                <tr>
                                    <td><asp:Label runat="server" ID="lblNome" /></td>
                                    <td><asp:Label runat="server" ID="lblEmail" /></td>
                                    <td><asp:Label runat="server" ID="lblCPF" /></td>
                                    <td><asp:ImageButton runat="server" ID="imbEnviarEmail" ImageUrl="~/Files/Layout/Buttons/Email.png"
                                        OnClick="imbEnviarEmail_Click" /> </td>
                                    <td><asp:ImageButton runat="server" ID="imbExcluir" ImageUrl="~/Files/Layout/Excluir.gif" OnClick="imbExcluirPendente_Click"
                                        OnClientClick="javascript:return confirm('Tem certeza que deseja excluir esse selecionador?');" /> </td>
                                </tr>
                            </ItemTemplate>
                            <EmptyDataTemplate>
                                <asp:Label runat="server" ID="lblVazio" Text="Não há selecionadores pendentes" CssClass="failureNotification" />
                            </EmptyDataTemplate>
                        </portal:ListView>
                    </ContentTemplate>
                </asp:TabPanel>
            </asp:TabContainer>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
 